import Relay from "react-relay";

export default class GetOrderByTraffickerMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { getOrderByTrafficker }`;
    }

    getVariables() {
        return {
            argsInput: {
                enId: this.props.enId,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on getOrderByTraffickerPayload {
            getOrderByTrafficker {
                errorCode
                value
                totalResult
                id
                orders{
                   account
                   partAName
                   partBName
                   oid
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
              fragment on getOrderByTraffickerPayload {
                    getOrderByTrafficker {
                        errorCode
                        value
                        totalResult
                        id
                        orders{
                           account
                           partAName
                           partBName
                           oid
                        }
                    }
                }
            `]
        }];
    }

}
